//
//  SkinCell.m
//  TheProjectName
//
//  Created by 李劲成 on 16/5/26.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "SkinCell.h"

@interface SkinCell ()

@property (nonatomic, strong) UIImageView *m_photo;

@end

@implementation SkinCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.m_photo = [[UIImageView alloc]init];
        [self.contentView addSubview:_m_photo];
    }
    return self;
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    [_m_photo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(5);
        make.left.equalTo(self.contentView.mas_left).with.offset(5);
        make.right.equalTo(self.contentView.mas_right).with.offset(-5);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-5);
    }];
}

-(void)setM_image:(UIImage *)m_image{
    if (_m_image != m_image) {
        _m_image = m_image;
        _m_photo.image = _m_image;
    }
}
@end
